1. Field of the Invention
The present invention is directed to computer systems. More particularly, it is directed to graphics programming and processing.
2. Description of the Related Art
Rendering an image using a graphics processing unit (GPU) frequently involves the use of custom programmed “shader” programs executing on the GPU. Shader programs are generally coded individually for different GPU platforms application programming interfaces (APIs) or shader programming languages, such as DirectX, OpenGL, High Level Shader Language (HLSL), OpenGL Shader Language (GLSL), etc. Additionally, an application would include several (or many) individual shader programs for applying various graphic operations when rendering an image. Graphic applications frequently must support multiple platform APIs (also known as shader programming languages) in order to support the numerous types of GPU hardware that exist. Thus, developing a graphic application may require custom programming of various versions of the same shader program in order to support the different platform APIs.
Different GPU platform APIs, such as Direct X or OpenGL, provide different APIs in order to write shader programs. Sometimes the program can be compiled at runtime by the API or driver. Sometimes it is possible to pre-compile shader programs as bytecode, and only run the assembler at runtime. For a complex application that uses a large set of shader programs for various different APIs and platforms may have to be created and maintained. For example, using OpenGL, the application might sometimes have to provide several sets of the same shader programs to support different available versions of OpenGL. Another example is DirectX 9 that allows the shader programs to be either compiled or assembled at runtime, leading to different formats and runtime images for the application to handle. Thus, an application that supports both OpenGL and DirectX 9 may need to include several different versions of every shader program used by the application.